import { Component, OnInit } from '@angular/core';
import { CommonList } from '../common/model/commom.model';
import { ASYNC_URLS } from '../r-mobile-url';

@Component({
  selector: 'oy-purchase-list',
  templateUrl: './purchase-list.component.html',
  styleUrls: ['./purchase-list.component.scss']
})
/**
 * 描述：请购订单列表
 * 公司：xxx有限公司
 * 版权：xxx2020
 * 作者：oyjl
 * 时间：2020-04-26 15:12:13
 */
export class PurchaseListComponent implements OnInit {

  public commonList: CommonList;
  constructor() {
    this.commonList = new CommonList({
      head: '采购单列表',
      tabConfig: [
        {
          head: '待审核', isRequest: true, url: ASYNC_URLS.purchaseList,
          req: {
            oaPurchase: {},
            dingFlag: '1'
          },
          jumpUrl: '/mobile/purchaseDetail/audit',
          listConfig: {
            id: 'purchaseId',
            head: {
              text: '采购订单号', orderNum: 'purchaseNo', status: 'tableStatusName',
            },
            fields: [
              { text: '供应商名称', field: 'vendorName' },
              { text: '采购商名称', field: 'companyName' },
              { text: '采购人', field: 'personName' },
              { text: '采购数量', field: 'purchaseCount' }
            ]
          }
        },
        {
          head: '已审核', isRequest: true, url: ASYNC_URLS.purchaseList,
          req: {
            oaPurchase: {},
            dingFlag: '2'
          },
          jumpUrl: '/mobile/purchaseDetail/detail',
          listConfig: {
            id: 'purchaseId',
            head: {
              text: '采购订单号', orderNum: 'purchaseNo', status: 'tableStatusName',
            },
            fields: [
              { text: '供应商名称', field: 'vendorName' },
              { text: '采购商名称', field: 'companyName' },
              { text: '采购人', field: 'personName' },
              { text: '采购数量', field: 'purchaseCount' }
            ]
          }
        }
      ]
    });
  }

  ngOnInit() {
  }

}
